//package com.yyk.yiliao.moudle.activity;
//
//import android.content.Intent;
//import android.os.Bundle;
//import android.support.v7.widget.DividerItemDecoration;
//import android.support.v7.widget.LinearLayoutManager;
//import androidx.recyclerview.widget.RecyclerView;
//import android.view.View;
//import android.widget.TextView;
//
//import com.google.gson.Gson;
//import com.orhanobut.hawk.Hawk;
//import com.orhanobut.logger.Logger;
//import com.yyk.yiliao.R;
//import com.yyk.yiliao.base.BaseActivity;
//import com.yyk.yiliao.base.BaseRecyclerAdapter;
//import com.yyk.yiliao.base.BaseRecyclerHolder;
//import com.yyk.yiliao.bean.Member_Info;
//import com.yyk.yiliao.ui.activity.QueryMember2_Activity;
//import com.yyk.yiliao.ui.mine.activity.QueryMember_Activity;
//import com.yyk.yiliao.util.OkHttp3Utlis;
//import com.yyk.yiliao.util.ebs.TwoStringEvent;
//import com.yyk.yiliao.util.rx.ApiService;
//
//import org.greenrobot.eventbus.EventBus;
//
//import java.io.IOException;
//import java.util.HashMap;
//import java.util.List;
//
//import butterknife.BindView;
//import butterknife.ButterKnife;
//import butterknife.OnClick;
//import okhttp3.Call;
//import okhttp3.Callback;
//import okhttp3.Response;
//
///**
// * 就诊成员管理
// */
//public class Member_Activity extends BaseActivity {
//
//
//    @BindView(R.id.mMember_add)
//    TextView mMemberAdd;
//    @BindView(R.id.mMember_tishi)
//    TextView mMemberTishi;
//    @BindView(R.id.mMember_rv)
//    RecyclerView mMemberRv;
//    private BaseRecyclerAdapter<Member_Info.DataBean> adapter;
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_member);
//        ButterKnife.bind(this);
//        initHawk();
//        initData();
//
//    }
//
//    private void initHawk() {
//    }
//
//    private void initData() {
//        HashMap<String, String> map = new HashMap<>();
//        map.put("user_id", Hawk.get("uid")+"");
//
//        OkHttp3Utlis.getIntance().postOkhttp(ApiService.BASE_URL + "/mobile/Mymessage/visitlis", map, new Callback() {
//            @Override
//            public void onFailure(Call call, IOException e) {
//
//            }
//
//            @Override
//            public void onResponse(Call call, Response response) throws IOException {
//                String result = response.body().string().trim();
//                Logger.e(result);
//                Gson gson = new Gson();
//                final Member_Info member_info = gson.fromJson(result, Member_Info.class);
//                final List<Member_Info.DataBean> data = member_info.getData();
//                runOnUiThread(new Runnable() {
//                    @Override
//                    public void run() {
//
//                        if (member_info.getCode() == 1) {
//                            mMemberRv.setVisibility(View.VISIBLE);
//                            mMemberTishi.setVisibility(View.GONE);
//
//                            adapter = new BaseRecyclerAdapter<Member_Info.DataBean>(getApplicationContext(), data, R.layout.adapter_item_member) {
//                                @Override
//                                public void convert(BaseRecyclerHolder holder, final Member_Info.DataBean info, final int position, boolean isScrolling) {
//                                    holder.setText(R.id.b_real_name, info.getReal_name());
//                                    holder.getView(R.id.b_see).setOnClickListener(new View.OnClickListener() {
//                                        @Override
//                                        public void onClick(View v) {
//                                            int patient_id =info.getPatient_id();
//                                            int status = info.getStatus();
//                                            if (status == 1) {
//                                                Intent intnet = new Intent(Member_Activity.this, QueryMember_Activity.class);
//                                                //                                        intnet.putExtra("patient_id", patient_id + "");
//                                                //                                        intnet.putExtra("status", status + "");
//                                                EventBus.getDefault().postSticky(new TwoStringEvent(patient_id + "",status+""));
//                                                startActivity(intnet);
//                                            } else {
//                                                Intent intnet = new Intent(Member_Activity.this, QueryMember2_Activity.class);
//                                                //                                        intnet.putExtra("patient_id", patient_id + "");
//                                                //                                        intnet.putExtra("status", status + "");
//                                                EventBus.getDefault().postSticky(new TwoStringEvent(patient_id + "",status+""));
//                                                startActivity(intnet);
//                                            }
//                                        }
//                                    });
//
//                                }
//                            };
//                            mMemberRv.addItemDecoration(new DividerItemDecoration(Member_Activity.this, DividerItemDecoration.VERTICAL));
//                            mMemberRv.setLayoutManager(new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.VERTICAL, false));
//                            mMemberRv.setAdapter(adapter);
////                            adapter.setOnItemClickListener(new BaseRecyclerAdapter.OnItemClickListener() {
////                                @Override
////                                public void onItemClick(RecyclerView parent, View view, int position) {
////                                    int patient_id = data.get(position).getPatient_id();
////                                    int status = data.get(position).getStatus();
////                                    String name = data.get(position).getReal_name();
////                                    if (status == 1) {
////
////                                        EventBus.getDefault().postSticky(new MessageEvent2(name + "",patient_id+""));
////                                        finish();
////                                    } else {
//////                                        intnet.putExtra("patient_id", patient_id + "");
//////                                        intnet.putExtra("status", status + "");
////                                        EventBus.getDefault().postSticky(new MessageEvent2(name + "",patient_id+""));
////                                        finish();
////
////                                    }
////
////                                }
////                            });
//                        } else {
////                            Toast.makeText(Member_Activity.this, "没有数据", Toast.LENGTH_SHORT).show();
//                        }
//                    }
//                });
//            }
//        });
//    }
//
//
//    @OnClick({R.id.mMember_add, R.id.mMember_tishi})
//    public void onViewClicked(View view) {
//        switch (view.getId()) {
//            case R.id.mMember_add:
//                Intent intent = new Intent(Member_Activity.this, AddMember3_Activity.class);
//                startActivity(intent);
//                this.finish();
//                break;
//            case R.id.mMember_tishi:
//                break;
//        }
//    }
//
//    @Override
//    public void onBackPressed() {
//        super.onBackPressed();
//
//
//    }
//}
